package com.ruoyi.order.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.SysProdAttaMapper;
import com.ruoyi.order.domain.SysProdAtta;
import com.ruoyi.order.service.ISysProdAttaService;

/**
 * 商品附件Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-04
 */
@Service
public class SysProdAttaServiceImpl implements ISysProdAttaService 
{
    @Autowired
    private SysProdAttaMapper sysProdAttaMapper;

    /**
     * 查询商品附件
     * 
     * @param attaId 商品附件主键
     * @return 商品附件
     */
    @Override
    public SysProdAtta selectSysProdAttaByAttaId(Long attaId)
    {
        return sysProdAttaMapper.selectSysProdAttaByAttaId(attaId);
    }

    /**
     * 查询商品附件列表
     * 
     * @param sysProdAtta 商品附件
     * @return 商品附件
     */
    @Override
    public List<SysProdAtta> selectSysProdAttaList(SysProdAtta sysProdAtta)
    {
        return sysProdAttaMapper.selectSysProdAttaList(sysProdAtta);
    }

    /**
     * 新增商品附件
     * 
     * @param sysProdAtta 商品附件
     * @return 结果
     */
    @Override
    public int insertSysProdAtta(SysProdAtta sysProdAtta)
    {
        sysProdAtta.setCreateTime(DateUtils.getNowDate());
        return sysProdAttaMapper.insertSysProdAtta(sysProdAtta);
    }

    /**
     * 修改商品附件
     * 
     * @param sysProdAtta 商品附件
     * @return 结果
     */
    @Override
    public int updateSysProdAtta(SysProdAtta sysProdAtta)
    {
        sysProdAtta.setUpdateTime(DateUtils.getNowDate());
        return sysProdAttaMapper.updateSysProdAtta(sysProdAtta);
    }

    /**
     * 批量删除商品附件
     * 
     * @param attaIds 需要删除的商品附件主键
     * @return 结果
     */
    @Override
    public int deleteSysProdAttaByAttaIds(Long[] attaIds)
    {
        return sysProdAttaMapper.deleteSysProdAttaByAttaIds(attaIds);
    }

    /**
     * 删除商品附件信息
     * 
     * @param attaId 商品附件主键
     * @return 结果
     */
    @Override
    public int deleteSysProdAttaByAttaId(Long attaId)
    {
        return sysProdAttaMapper.deleteSysProdAttaByAttaId(attaId);
    }
}
